<template>
  <view>
    <up-modal
      :show="system.getErrorShow"
      :title="title"
      :showCancelButton="system.errorMsg.type"
      :content="system.errorMsg.msg"
      @close="closeError"
      @confirm="confirm"
      @cancel="closeError"
      contentTextAlign="center"
    ></up-modal>
  </view>
</template>

<script setup>
import { systemStore } from '@/stores/system'
import { useStore } from '@/stores/user'
import { ref } from 'vue'

const system = systemStore()
const userInfo = useStore()
const title = ref('提示')
const closeError = () => {
  system.hideError()
}
const  confirm=()=>{
  system.errorMsg.type?login() :system.hideError()
}
const login =()=>{
  userInfo.emptyUserInfo()
  system.hideError()
  uni.navigateTo({
    url: '/pages/login/index'
  })
}
</script>

<style lang="scss"></style>
